#!/usr/bin/env python


# Echo client program
import socket

HOST = 'localhost'    # The remote host
PORT = 50007              # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
print'Acquiring name...'
s.send('get_name')
servername=s.recv(1024)
print 'Received name: '+str(servername)

while True:
	com=raw_input('\>> ')
	if com.lower()=='quit': break
	elif com=='': com='_NULLstring_'
	s.send(str(com))
	data = s.recv(1024)
	print servername,' says: ', repr(data)
	
	
s.close()
print 'Received', repr(data)
